package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class FriendsVo implements Serializable {
    private Integer id; //用户id
    private String avatar; //用户头像
    private String nickname;//昵称
    private String gender;//性别
    private Integer age;//年龄
    private String city;//城市
    private String education;//学历
    private Integer marriage;//婚姻状态
    private Integer matchRate;//匹配度
    private Boolean alreadyLove;//是否喜欢

    public static FriendsVo init(UserInfo userInfo) {
        FriendsVo friendsVo = new FriendsVo();
        friendsVo.setId(Math.toIntExact(userInfo.getId()));
        friendsVo.setAvatar(userInfo.getAvatar());
        friendsVo.setNickname(userInfo.getNickname());
        friendsVo.setGender(userInfo.getGender());
        friendsVo.setAge(userInfo.getAge());
        friendsVo.setCity(userInfo.getCity());
        friendsVo.setEducation(userInfo.getEducation());
        friendsVo.setMarriage(userInfo.getMarriage());
        return friendsVo;
    }

}
